package com.leo.customer.manager

interface RedisManager {

    /**
     * 存储对象
     */
    fun setObj(key: String, obj: Any, timeOut: Long)

    /**
     * 存储字符串
     */
    fun setString(key: String, obj: String, timeOut: Long)

    /**
     * 存储Token
     */
    fun setToken(key: String, obj: Any)

    /**
     * 通过Key获取对象
     */
    fun <T> getObj(key: String, clazz: Class<T>): T?

    /**
     * 通过Key获取字符串
     */
    fun getString(key: String): String

    /**
     * 获取Token存储的对象
     */
    fun <T> getObjByToken(key: String, clazz: Class<T>): T?

    fun exists(key: String): Boolean
}
